﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BackgoodsList.aspx.cs" Inherits="Hospital_BackgoodsList" %>

<%@ Register Src="../System/DbPageFlip.ascx" TagName="DbPageFlip" TagPrefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../styles/css.css" rel="stylesheet" type="text/css">

    <script language="vbscript" src="../Common/yz.vbs"></script>

    <script language="javascript">
    
        function SelectAll()
        {
            var i;
             var a = document.getElementsByName('chk');
             for( i = 0;i < a.length;i++)
            {
                a[i].checked = true; 
            }           
        }
        function ClearAll()
        {
            var i;
             var a = document.getElementsByName('chk');
             
             for( i = 0;i < a.length;i++)
            {
                a[i].checked = false; 
            }           
        }
        function CheckOthers()
        {
            var i;
            var a = document.getElementsByName('chk');
             
             for( i = 0;i < a.length;i++)
            {
            
                if(a[i].checked!=true)
                {
                    a[i].checked =true ; 
                }
                else
                {   
                    a[i].checked = false; 
                }
            }           
            
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div style="text-align: center">
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td style="width: 4px">
                        <img src="../images/intro_left.gif" width="4" height="34" alt=""/></td>
                    <td class="intro_wordbg">
                        退货药品清单</td>
                    <td style="background:url(../images/intro_bg.gif); ">
                        <img src="../images/intro_right.jpg" width="118" height="34" alt="" /></td>
                </tr>
            </table>
            <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table_table2">
                <tr>
                    <td class="table_td3" style="width: 143px; height: 28px;">
                        退货医院</td>
                    <td class="table_td2" style="height: 28px; width: 307px;">
                        <span style="color: #ff6666">
                            <asp:Label ID="LabHospital" runat="server" Text="Label" Width="163px"></asp:Label></span></td>
                    <td class="table_td3">
                        退货单名称</td>
                    <td class="table_td2" style="height: 28px; width: 230px;">
                        <asp:TextBox ID="txtPlanName" runat="server" NotNull="退货单名称" InvertedComma="退货单名称"
                            Width="200px" CssClass="input_text"></asp:TextBox><span style="color: #ff6666">(*)</span></td>
                </tr>
            </table>
            <table width="98%" align="center" id="tabData">
                <tr>
                    <td align="right" style="width: 21%; height: 26px;">
                        通用名：</td>
                    <td align="left" style="width: 19%; height: 26px;">
                        <%--<asp:TextBox ID="TextProductName" runat="server" InvertedComma="通用名" Width="200px" CssClass="input_text"></asp:TextBox>--%>
                        <asp:TextBox ID="TextProductName" runat="server" InvertedComma="通用名" Width="200px" CssClass="input_text"></asp:TextBox>
                    </td>
                    <td align="right" style="width: 16%; height: 26px;">
                        药品流水号：</td>
                    <td align="left" style="width: 20%; height: 26px;">
                        <asp:TextBox ID="TextGoodsId" runat="server" NumericOnly="药品流水号" Width="200px" CssClass="input_text"></asp:TextBox></td>
                </tr>
                <tr>
                    <td align="right" style="width: 21%">
                        生产企业：</td>
                    <td align="left" style="width: 19%">
                        <asp:TextBox ID="TextCompanyName_SC" runat="server" InvertedComma="生产企业" Width="200px"
                            CssClass="input_text"></asp:TextBox></td>
                    <td align="right" style="width: 16%">
                        生产企业编号：</td>
                    <td align="left" style="width: 25%">
                        <asp:TextBox ID="TextUserCode_SC" runat="server" CssClass="input_text" InvertedComma="生产企业流水号"
                            Width="200px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td align="right" style="width: 21%">
                        配送企业：</td>
                    <td align="left" style="width: 19%">
                        <asp:TextBox ID="TextCompanyName_PS" runat="server" CssClass="input_text" InvertedComma="配送企业"
                            Width="200px"></asp:TextBox></td>
                    <td align="right" style="width: 16%">
                        配送企业编码：</td>
                    <td align="left" style="width: 25%">
                        <asp:TextBox ID="TextUserCode_PS" runat="server" CssClass="input_text" InvertedComma="配送企业编码"
                            Width="200px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td align="right" style="width: 21%">
                        目录范围：</td>
                    <td align="left" style="width: 19%">
                        <asp:DropDownList ID="DropDownList1" CssClass="input_text" runat="server" Width="199px">
                            <asp:ListItem Selected="True" Value="1">未退货的已购药品</asp:ListItem>
                            <asp:ListItem Value="2">所有已购药品</asp:ListItem>
                        </asp:DropDownList></td>
                    <td align="center" style="width: 16%">
                    </td>
                    <td align="center" style="width: 25%">
                        <input id="Submit3" class="button_bg6" name="btnSubmit1" style="width: 72px" type="submit"
                            onclick="javascript:return CheckForm();" value="查 询" /></td>
                </tr>
            </table>

            <asp:DataList ID="DlAttorney" runat="server" Width="98%" CssClass='table_table' HeaderStyle-CssClass='table_title'>
                <ItemStyle CssClass="table_td" />
                <AlternatingItemStyle CssClass="table_td2" />
                <SeparatorStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" Wrap="False" />
                <HeaderTemplate>
                    <table width='98%'>
                        <tr>
                            <td width='8%'>
                                药品流水号</td>
                                <td width='8%'>
                                采购批号</td>
                                <td width='3%'>
                                采购流水号</td>
                            <td width='8%'>
                                通用名</td>
                            <td width='5%'>
                                商品名</td>
                            <td nowrap>
                                剂型</td>
                            <td width='5%'>
                                转换系数</td>
                            <td width='3%'>
                                包装规格</td>
                            <td width='8%'>
                                质量层次</td>
                            <td width='8%'>
                                交易价</td>
                            <td width='8%'>
                                挂网企业名称</td>
                            <td width='9%'>
                                生产企业编号</td>
                            <td width='9%'>
                                生产企业</td>
                            <td width='9%'>
                                配送企业编号</td>
                            <td width='9%'>
                                配送企业</td>
                            <td nowrap>
                                选择</td>
                        </tr>
                    </table>
                </HeaderTemplate>
                <ItemTemplate>
                    <table width='98%'>
                        <tr>
                            <td width='8%'>
                                <%# DataBinder.Eval(Container.DataItem, "GoodsId")%>
                            </td>
                             <td width='8%'>
                                <%# DataBinder.Eval(Container.DataItem, "batchnumber")%>
                            </td>
                            <td width='3%'>
                                <input type="hidden" name='buyplan<%# DataBinder.Eval(Container.DataItem, "BuyPlanGoodsId")%>' value='<%# DataBinder.Eval(Container.DataItem, "buyplanid") %>'>
                                <%# DataBinder.Eval(Container.DataItem, "buyplanid") %>
                            </td>
                            <td width='8%'>
                                <%# DataBinder.Eval(Container.DataItem, "ProductName")%>
                            </td>
                            <td width='5%'>
                                <%# DataBinder.Eval(Container.DataItem, "GoodsName")%>
                            </td>
                            <td nowrap>
                                <%# DataBinder.Eval(Container.DataItem, "Medicinemodel")%>
                            </td>
                            <td width='5%'>
                                <%# DataBinder.Eval(Container.DataItem, "Factor")%>
                            </td>
                            <td width='3%'>
                                <%# DataBinder.Eval(Container.DataItem, "Pack1")%>
                            </td>
                            <td width='8%'>
                                <%# DataBinder.Eval(Container.DataItem, "QualityLevels")%>
                            </td>
                            <td width='8%'>
                                <%# DataBinder.Eval(Container.DataItem, "TradePrice")%>
                            </td>
                            <td width='8%'>
                                <%# DataBinder.Eval(Container.DataItem, "CompanyName_TB")%>
                            </td>
                            <td width='9%'>
                                <%# DataBinder.Eval(Container.DataItem, "UserCode_SC")%>
                            </td>
                            <td width='9%'>
                                <%# DataBinder.Eval(Container.DataItem, "CompanyName_SC")%>
                            </td>
                            <td width='9%'>
                                <%# DataBinder.Eval(Container.DataItem, "UserCode_PS")%>
                            </td>
                            <td width='9%'>
                                <%# DataBinder.Eval(Container.DataItem, "CompanyName_PS")%>
                                
                            </td>
                           
                            <script type="text/javascript">
                                var vtext = '<%# DataBinder.Eval(Container.DataItem, "ReturnState")%>';
                                if (vtext == '退货中') {
                                    document.write("<td width='6%' align='center'>" + vtext + "</td>");
                                }
                                else {
                                    var v_chk = '<%# DataBinder.Eval(Container.DataItem, "BuyPlanGoodsId")%>';
                                    var v_aps = '<%# DataBinder.Eval(Container.DataItem, "AccountId_PS") %>';
                                    var v_apsName = 'AccountId_PS<%# DataBinder.Eval(Container.DataItem, "BuyPlanGoodsId") %>';
                                    document.write("<td width='6%' align='center'>");
                                    
                                    document.write("<input name='chk' type='checkbox' value='" + v_chk + "'>");
                                    document.write("<input type='hidden' name='"+v_apsName+"' value='" + v_aps + "'>");
                                
                                    document.write("</td>");
                                }
                            </script>
                            
                                <%--<td style="width:6%; text-align:center; ">
                                    <input name="chk" type="checkbox" value='<%# DataBinder.Eval(Container.DataItem, "BuyPlanGoodsId")%>'>
                                    <input type="hidden" name='AccountId_PS<%# DataBinder.Eval(Container.DataItem, "BuyPlanGoodsId")%>' value='<%# DataBinder.Eval(Container.DataItem, "AccountId_PS") %>'>
                                </td>--%>
                            
                           
                        </tr>
                    </table>
                </ItemTemplate>
                <HeaderStyle CssClass="table_title" />
            </asp:DataList>
                        <div align="right">
                <table>
                    <tr>
                        <td>
                            <uc1:DbPageFlip ID="DbPageFlip1" runat="server" />
                        </td>
                        <td>
                            <input id="but1" type="button" class="button_bg6" value="全选" onclick="javascript:SelectAll();" /></td>
                        <td>
                            <input id="but2" type="button" class="button_bg6" value="清空" onclick="javascript:ClearAll();" /></td>
                        <td>
                            <input id="but3" type="button" class="button_bg6" value="反选" onclick="javascript:CheckOthers();" /></td>
                        <td>
                            <input type="submit" name="btnSubmit" value="确定选取" class="button_bg6" onclick="javascript:return confirm('确定真的选取吗？？？？ ');"
                                id="Submit1" style="width: 64px" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </form>
</body>
</html>

